package StudyCode.summary.Basic.console;

import java.util.Scanner;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadHasBoolean {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入Boolean值:");
		while (scanner.hasNext()) {
			if (scanner.hasNextBoolean()) {
				System.out.println("你输入的Boolean值是:" + scanner.nextBoolean());
				break;
			} else {
				System.out.println("请输入Boolean值:");
				scanner.next();
			}
		}
	}
}
